package com.txts.road.app.track.service;

import com.txts.road.app.track.model.dto.LocationPointDTO;
import com.txts.road.app.track.model.entity.TrackRecordEntity;
import com.txts.road.app.track.model.dto.TrackRecordDTO;
import com.txts.road.app.track.model.query.TrackRecordQuery;
import com.txts.road.app.track.model.vo.TrackRecordVO;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 轨迹记录服务类
 *
 * @author baoyr
 * @since 2025-07-17 10:43
 */
public interface TrackRecordService extends IService<TrackRecordEntity> {
    /**
     * 开始记录轨迹
     *
     * @param startDTO 开始记录轨迹参数
     * @return 轨迹记录ID
     */
    Long startTrackRecord(@RequestBody TrackRecordDTO startDTO);

    /**
     * 停止记录轨迹
     *
     * @param trackId 轨迹记录ID
     * @return true-成功 false-失败
     */
    Boolean stopTrackRecord(@PathVariable Long trackId);

    /**
     * 上传位置点
     *
     * @param trackId  轨迹记录ID
     * @param pointDTO 位置点参数
     * @return true-成功 false-失败
     */

    Boolean uploadLocationPoint(@PathVariable Long trackId, @RequestBody LocationPointDTO pointDTO);

    /**
     * 批量上传位置点
     *
     * @param trackId 轨迹记录ID
     * @param points  批量上传位置点参数
     * @return true-成功 false-失败
     */
    Boolean batchUploadLocationPoints(@PathVariable Long trackId, @RequestBody List<LocationPointDTO> points);

    /**
     * 获取轨迹列表
     *
     * @param query 轨迹列表参数
     * @return 轨迹列表
     */
    List<TrackRecordVO> getTrackList(@RequestBody TrackRecordQuery query);

    /**
     * 获取轨迹详情
     *
     * @param trackId 轨迹ID
     * @return 轨迹详情
     */
    TrackRecordVO getTrackDetail(@PathVariable Long trackId);

    /**
     * 删除轨迹
     *
     * @param trackId 轨迹ID
     * @return true-成功 false-失败
     */
    Boolean deleteTrack(@PathVariable Long trackId);
}
